using System.Diagnostics;
using System.ServiceProcess;

namespace SharpService.Test
{
    public class ConstructorArgService : ServiceBase
    {
        private readonly string[] _args;

        public ConstructorArgService(string[] configArgs)
        {
            _args = configArgs;
            Log(_args);
        }

        protected override void OnStart(string[] args)
        {
            Log(args);
            Log("ConstructorArgService started");
        }

        public static void Log(params string[] args)
        {
            foreach (string arg in args)
            {
                EventLog.WriteEntry("SharpService.Test.ConstructorArgService", arg, EventLogEntryType.Information);
            }
        }
    }
}